<template>

</template>

<script lang="ts">
import { defineComponent } from 'vue'
import { MessagePlugin } from 'tdesign-vue-next'

export default defineComponent({
  inheritAttrs: false,
  data() {
    return {
      data: {
        element: null,
        stream: null,
      },
    }
  },
  mounted() {},
  methods: {
  

    OpenAudio(deviceId: string) {
      // 打开音频
      var _this = this

      try {
        navigator.mediaDevices.getUserMedia({ audio: { deviceId: deviceId } }).then(function (stream) {
          _this.data.stream = stream
        })
      } catch (e) {
        MessagePlugin.closeAll()
        MessagePlugin.error('打开音频失败')
      }
      this.visible = false
    },
  },
})
</script>
<style scoped></style>
